package adv2;

import java.util.Scanner;

public class ComTest {

	public static void main(String[] args) {
		Company c = new Company();
		Scanner in = new Scanner(System.in);
		int ch = 0;
		while (true) {
			System.out.println("1:查看公司信息\n2:招新人\n3:开除\n9:退出");
			ch = in.nextInt();
			if (ch == 1) {
				c.showInfo();
			} else if (ch == 2) {
				System.out.println("请输入工号，姓名，年龄，性别，职务，薪水");
				Yuangong y = new Yuangong();
				y.setGonghao(in.next());
				y.setName(in.next());
				y.setAge(in.nextInt());
				y.setSex(in.next());
				y.setZhiwu(in.next());
				y.setXinshui(in.nextDouble());

				c.add(y);

			} else if (ch == 3) {
				System.out.println("请输入要开除的员工的工号：");
				String no = in.next();
				boolean d = c.dismiss(no);
				System.out.println(d ? "开除成功" : "查无此人");
			} else if (ch == 9) {
				break;
			}
		}
	}

}
